package models

import "github.com/dgrijalva/jwt-go"

type SignClaim struct {
	User string `json:"user"`
	Addr string `json:"addr"`
	AuthLevel int `json:"auth_lv"`
	SystemLevel int `json:"system_lv"`
	AdminLevel int `json:"security_lv"`
	jwt.StandardClaims
}

func NewSignClaim(u User, addr string) *SignClaim {
	var claim = SignClaim{
		u.Username,
		addr,
		u.AuthLevel,
		u.SystemLevel,
		u.AdminLevel,
		jwt.StandardClaims{
			Issuer:u.Username,
		},
	}
	return &claim
}